package main

import (
	"fmt"
	"gorm-study/src/pkg/student/models"
	"gorm-study/src/pkg/utils/dbutil"
)

func main() {
	rows, err := dbutil.DB.Model(&models.Student{}).Select("name", "age").Rows()
	if err != nil {
		panic(err)
	}

	defer rows.Close()
	for rows.Next() {
		var name string
		var age int
		rows.Scan(&name, &age)
		fmt.Printf("name:%v, age:%v \n", name, age)
	}
}
